Skip to content

[v8] RFC-0045: Stack management#3687

Open
simonjjones wants to merge 14 commits intocloudfoundry:v8from
simonjjones:v8-stack-management
Open

[v8] RFC-0045: Stack management#3687
simonjjones wants to merge 14 commits intocloudfoundry:v8from
simonjjones:v8-stack-management

Conversation

@simonjjones
Copy link

Thank you for contributing to the CF CLI! Please read the following:

  • Please make sure you have implemented changes in line with the contributing guidelines
  • We're not allowed to accept any PRs without a signed CLA, no matter how small.
    If your contribution falls under a company CLA but your membership is not public, expect delays while we confirm.
  • All new code requires tests to protect against regressions.
  • Contributions must be made against the appropriate branch. See the contributing guidelines
  • Contributions must conform to our style guide. Please reach out to us if you have questions.

Note: Please create separate PR for every branch (main and v8) as needed.

Description of the Change

This PR covers the CLI implementation details for RFC-0045: Enhance Stack Handling in Cloud Foundry. It adds an additional state field to output of the cf stack, cf stacks & cf update-stack commands, as well as adding the ability to modify the state to the cf update-stack command. This is a partner PR to the existing Cloud Controller changes submitted for review

Why Is This PR Valuable?

These changes will be required for consumers to interact with the new features available in the Cloud Controller, the RFC has been accepted, indicating the changes are valuable.

Applicable Issues

N/A

How Urgent Is The Change?

This should be accepted and released in line with the changes being proposed to the Cloud Controller

Other Relevant Parties

The Cloud Controller changes linked above should detail other people impacted.

Signed-off-by: Simon Jones <simonjones@vmware.com>
Signed-off-by: Simon Jones <simonjones@vmware.com>
Signed-off-by: Simon Jones <simonjones@vmware.com>
Signed-off-by: Simon Jones <simonjones@vmware.com>
Signed-off-by: Simon Jones <simonjones@vmware.com>
Signed-off-by: Simon Jones <simonjones@vmware.com>
Signed-off-by: Simon Jones <simonjones@vmware.com>
@simonjjones simonjjones marked this pull request as draft January 21, 2026 17:17
Signed-off-by: Simon Jones <simonjones@vmware.com>
@simonjjones simonjjones marked this pull request as ready for review January 28, 2026 16:38
Copy link
Contributor

@vuil vuil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes. I added a couple of minor suggestions. I assume this needs to wait till the cloud-controller changes are merged?

Copy link

@rashedkvm rashedkvm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a reminder to update the minimum API version prior to merging. Much appreciated!

@anujc25 anujc25 changed the title V8 stack management [v8] RFC-0045: Stack management Feb 4, 2026
Copy link
Contributor

@vuil vuil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were some recent CI fixes that should move the integ tests along now.

Changes looks good to me. My comments are mostly minor indentation issues (probably also present in #3688 as well)

{"env", "set-env", "unset-env"},
{"stacks", "stack"},
{"copy-source", "create-app-manifest"},
{"env", "set-env", "unset-env"},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: fix indent?

fakeActor.GetStackByNameReturns(stack, v7action.Warnings{}, nil)
})

It("Displays the stack information without state", func() {
Copy link
Contributor

@vuil vuil Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the comments here.
nit: it's odd I am not seeing the issue on the github page, but when I checked out the branch, it is showing this It("Displays... block is misindented by one fewer level. Same is true the next It(Displays.. block

Comment on lines +159 to +195
Context("when state values are provided in different cases", func() {
It("accepts 'active' and capitalizes it", func() {
cmd.State = "active"
fakeActor.GetStackByNameReturns(resources.Stack{GUID: "guid"}, v7action.Warnings{}, nil)
fakeActor.UpdateStackReturns(resources.Stack{Name: "some-stack", State: resources.StackStateActive}, v7action.Warnings{}, nil)

executeErr = cmd.Execute(args)

Expect(executeErr).ToNot(HaveOccurred())
_, state := fakeActor.UpdateStackArgsForCall(0)
Expect(state).To(Equal(resources.StackStateActive))
})

It("accepts 'RESTRICTED' and keeps it capitalized", func() {
cmd.State = "RESTRICTED"
fakeActor.GetStackByNameReturns(resources.Stack{GUID: "guid"}, v7action.Warnings{}, nil)
fakeActor.UpdateStackReturns(resources.Stack{Name: "some-stack", State: resources.StackStateRestricted}, v7action.Warnings{}, nil)

executeErr = cmd.Execute(args)

Expect(executeErr).ToNot(HaveOccurred())
_, state := fakeActor.UpdateStackArgsForCall(0)
Expect(state).To(Equal(resources.StackStateRestricted))
})

It("accepts 'Disabled' and capitalizes it", func() {
cmd.State = "Disabled"
fakeActor.GetStackByNameReturns(resources.Stack{GUID: "guid"}, v7action.Warnings{}, nil)
fakeActor.UpdateStackReturns(resources.Stack{Name: "some-stack", State: resources.StackStateDisabled}, v7action.Warnings{}, nil)

executeErr = cmd.Execute(args)

Expect(executeErr).ToNot(HaveOccurred())
_, state := fakeActor.UpdateStackArgsForCall(0)
Expect(state).To(Equal(resources.StackStateDisabled))
})
})
Copy link
Contributor

@vuil vuil Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: did you mean to have this block be a child context of "Context("When the environment is setup correctly" ? Probably doesn't matter either way but if it is meant to be, then its indent is a little off.

}

// ValidStackStatesString returns a pipe-separated string of valid states in lowercase
func ValidStackStatesString() string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Unused code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants